package ge.tsu.java.project.commons;

import java.io.Serializable;
import java.util.Date;

public class Message implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Type type;
	private Date dateSent;

	public static Message newMessage(Type type) {
		Message msg = new Message();
		msg.type = type;
		msg.dateSent = new Date();
		return msg;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public Date getDateSent() {
		return dateSent;
	}

	public void setDateSent(Date dateSent) {
		this.dateSent = dateSent;
	}

	public static enum Type {
		REGISTER, 
		AUTHENTICATE, 
		CHAT_MESSAGE, 
		SEND_CONTACT_LIST, 
		GET_CONTACT_LIST, 
		CONTACT_STATUS_CHANGED, 
		EOF
	}
}
